<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------
namespace app\user_center\behavior\user\focus_user_after;
use util\Jpush;

/**
 * 关注成功后 发送极光消息
 * @package app\user_center\behavior\user
 * @author shiqiang
 */
class sendMessage{
    /**
     * 执行行为 run方法是Behavior唯一的接口
     * @access public
     * @return void
     */
    public function run($params){
		$uid 			= $params['uid'];
		$follow_uid 	= $params['follow_uid'];
		$follow_type 	= $params['follow_type'];
		
		$result = 0;
		$username = model('Member', 'model\user') -> find($uid) -> nick_name;
		if($follow_type == 1){//关注
			//关注
			$send_uid = $follow_uid;
			$title = "幕小铺";
			$content = $username.'点赞了你的视频。';
			$rel = controller('common/PushFactory', 'designpattern\push') -> setPush($type='');
			$result = $rel->setPushByAlias($alias=$send_uid, $title, $content);
	
			//本地消息存储

		}
		
    }
}
